<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"
    import="java.net.*" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctxPath" value="${pageContext.request.contextPath}" />

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>用户登陆</title>
  <link rel="stylesheet" href="layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="layuiadmin/style/login.css" media="all">
<%
String msg = request.getParameter("msg");
if( msg!=null ){
	byte[] buff = msg.getBytes("ISO-8859-1");
	msg = new String(buff,"UTF-8");
	//msg = 用户登录失败。
}else{
	msg = "";
}
%>

<script>
function gotoSub(){
	var form = document.getElementById( 'userForm' );
	form.submit();	
}

function keyFunc( e ){
	var keyNum = window.event ? e.keyCode : e.which;
	if( keyNum==13 ){
		gotoSub();
		return true;
	}
	return false;
}

function init(){
	//document.body.clientWidth 
	//var height = document.body.clientHeight;
	//var box = document.getElementById( 'up_box' );
	//box.style.marginTop = (height - 230)/2 +'px';
	
	var msg = '<%=msg%>';
	if( msg ){
		layer.msg( msg ,
				{icon:2,time:2000,offset:'60%'});
	}
}

</script>
</head>
<body onKeyUp="return keyFunc(event);" onload="init();">

  <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
      <div class="layadmin-user-login-box layadmin-user-login-header">
        <h2>酒店管理系统</h2>
        <p>小蓝与小姗</p>
      </div>
      <form id="userForm" action="${ctxPath}/User/login" accept-charset="UTF-8" method="post">
	      <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
	        <div class="layui-form-item">
	          <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
	          <input type="text" name="account" id="account" placeholder="用户名" class="layui-input">
	        </div>
	        <div class="layui-form-item">
	          <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
	          <input type="password" name="password" id="password" placeholder="密码" class="layui-input">
	        </div>
	        <!-- 可加入验证码 -->
	        <div class="layui-form-item">
	          <button class="layui-btn layui-btn-fluid" onClick="gotoSub();">登 入</button>
	        </div>
	      </div>
      </form>
    </div>
    
    <div class="layui-trans layadmin-user-login-footer">
      <p>© 2020 <a href="https://www.cnblogs.com/Lantxy" target="_blank">小蓝与小姗</a>  版权所有</p>
    </div>
    
  </div>
    <script src="${ctxPath}/layuiadmin/layui/layui.js"></script>  
<script>
layui.config({
    base: '${ctxPath}/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use('index', function(){
   	var layer = layui.layer
  });
</script>
</body>

</html>
				


